package main;
import conditions.*;


import java.util.Hashtable;
/**
 * Class that manages the player's scores
 * @author Bart and Justin
 *no parameters
 */
public class ScoreCounter {
	
	Hashtable<String, Condition> Conditions;
	int score=0;
	/**
	 * base constructor
	 * @param o Player who controls this score counter
	 */
	public ScoreCounter(Player o){
		//insert list of conditions here
		Conditions=new Hashtable<String, Condition>();
		Condition Culture=new Culture(o);
		Condition TotalRes500= new Resource1(o);
		Condition TotalRes700= new Resource2(o);
		Condition TotalRes1000= new Resource3(o);
		Condition ArmySize10= new ArmySize1(o);
		Condition ArmySize15= new ArmySize2(o);
		Condition ArmySize20= new ArmySize3(o);
		Condition Happiness50= new UltimateDespot(o);
		Condition Happiness150= new UltimateRuler(o);
		Condition Happiness75=new HatedRuler(o);
		Condition Happiness125=new LovedRuler(o);
		Condition TechMaster=new TechMaster(o);
		Condition BuildTank= new BuildTank(o);
		Condition MilitaryMaster= new MilitaryMaster(o);
		Conditions.put("Culture", Culture);
		Conditions.put("TotalRes500", TotalRes500);
		Conditions.put("TotalRes700", TotalRes700);
		Conditions.put("TotalRes1000", TotalRes1000);
		Conditions.put("ArmySize10", ArmySize10);
		Conditions.put("ArmySize15", ArmySize15);
		Conditions.put("ArmySize20", ArmySize20);
		Conditions.put("Happiness50", Happiness50);
		Conditions.put("Happiness150", Happiness150);
		Conditions.put("Happiness75", Happiness75);
		Conditions.put("Happiness125", Happiness125);
		Conditions.put("TechMaster", TechMaster);
		Conditions.put("BuildTank", BuildTank);
		Conditions.put("MilitaryMaster", MilitaryMaster);
	}
	/**
	 * Method to increment turn, called by higher increment turn method
	 */
	public void IncrementTurn(){
		for(String A: Conditions.keySet())
			Conditions.get(A).checkComplete();
	}
	/**
	 * method used to raise score when a condition is completed
	 * @param add the amount to add
	 */
	public void AddToScore(int add){
		score+=add;
	}
/**
 * returns the score
 * @return current score in int form
 */
	public int getScore(){
		return score;
	}
}
